package dongshi.daddy.controller;

import dongshi.daddy.other.Spokesman;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/my")
@Controller
public class MyController {

    @RequestMapping("/name")
    @ResponseBody
    public String name() {
        System.out.println("my name is ...");
        return "mr known!!";
    }

    @Resource
    private Spokesman spokesman;

    @RequestMapping("/starter")
    @ResponseBody
    public String starter() {
        System.out.println("starter ...");
        return spokesman.speak();
    }
}
